package com.tianma.springcloud.service;

import com.tianma.springcloud.pojo.Dept;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import java.util.List;

/**
 * @author lgc
 * @createDate 2020/9/3 - 11:37
 */
@FeignClient(value = "springcloud-provider-dept",fallback = DeptServiceHystrix.class)
public interface DeptServiceFeign {
    @RequestMapping(value = "/dept/add", method = RequestMethod.POST)
    boolean addDept(Dept dept);
    @GetMapping("/dept/get/{id}")
    Dept queryById(@PathVariable("id") Long id);
    @GetMapping("/dept/add")
    List<Dept> queryAll();
}
